package ljye.com.ljye.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.List;

import ljye.com.ljye.R;

/**
 */

public class Score_GridViewAdapter extends BaseAdapter {
    Context context;
    List<String> list;

    public Score_GridViewAdapter(Context context, List<String> list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int i) {
        return list.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        LayoutInflater layoutInflater = LayoutInflater.from(context);
        if (view == null) {
            view = layoutInflater.inflate(R.layout.layout_score_gridview, null);
            TextView tv = (TextView) view.findViewById(R.id.tv);
            tv.setText(list.get(i));
        }
        return view;

    }
}
